import request from '@/utils/request'

/**
 * 1C检测数据查询
 */
export function find1cDetectData(params) {
  return request({
    url: '/cms/detect1cJob/listPage',
    method: 'post',
    data: params
  })
}
/**
 * 2C检测数据查询
 */
export function find2cDetectData(params) {
  return request({
    url: '/cms/detectC2index/find2cDetectData',
    method: 'get',
    params: params
  })
}
export function get2cDetectData(data) {
  return request({
    url: '/cms/detect2cJob/listPage',
    method: 'post',
    data: data
  })
}
/**
 * 3C检测数据查询
 */
export function find3cDetectData(params) {
  return request({
    url: '/cms/detectC4index/find4cDetectData',
    method: 'get',
    params: params
  })
}
/**
 * 4C检测数据查询
 */
export function get4cDetectData(params) {
  return request({
    url: '/cms/detect4cJob/listPage',
    method: 'post',
    data: params
  })
}

export function find4cDetectData(params) {
  return request({
    url: '/cms/detectC4index/find4cDetectData',
    method: 'get',
    params: params
  })
}
/**
 * 5C检测数据查询
 */
export function find5cDetectData(params) {
  return request({
    url: '/cms/detectC5Job/find5CJob',
    method: 'get',
    params: params
  })
}

/**
 * 5C检测数据  获取支柱树数据
 */
export function find5CDevice(params) {
  return request({
    url: '/cms/detectC5Job/find5CDevice',
    method: 'get',
    params: params
  })
}

/**
 * 5C检测数据  压缩图片
 */
// export function imgDownLoad(params) {
//   return request({
//     url: '/cms/detectC5Job/imgDownLoad',
//     method: 'get',
//     params: params,
//     responseType: 'blob'
//   })
// }

/**
 * 5C检测数据  下载压缩包
 */
export function imgDownLoad(query) {
  return request({
    url: '/cms/detectC5Job/imgDownLoad?id=' + query.id,
    method: 'get',
    headers: {
      'Content-Type': 'application/octet-stream' // 流
    },
    'Content-Type': 'application/octet-stream', // 流
    responseType: 'blob'
  })
}

/**
 * 1C检测详情波形图
 */
export function findDetailWaveform(params) {
  return request({
    url: '/cms/detect1cData/listPage',
    method: 'post',
    data: params
  })
}
/**
 * 2C图片查询
 * @param {string} pillarCode
 */
export function getC2Images(params) {
  return request({
    url: '/cms/detectC2index/findImages',
    method: 'get',
    params: params
  })
}
/**
 * 2C图片查询
 * @param {string} detectJobId
 */
export function findImagesByJobId(params) {
  return request({
    url: '/cms/detectC2index/findImagesByJobId',
    method: 'get',
    params: params
  })
}

export function findc2ImagesByJobId(params) {
  return request({
    url: '/cms/detect2cIndex/findByJobId',
    method: 'post',
    data: params
  })
}
/**
 * 2C检测数据详情页面支柱号查询
 */
export function find2cDetailPillarNum(params) {
  return request({
    url: '/cms/detectC2index/find2cDetailPillarNum',
    method: 'get',
    params: params
  })
}
/**
 * 4C图片查询
 * @param {string} pillarCode
 */
export function getC4Images(params) {
  return request({
    url: '/cms/detectC4index/findImages',
    method: 'get',
    params: params
  })
}
/**
 * 4C检测数据详情页面支柱号查询
 */
export function find4cDetailPillarNum(params) {
  return request({
    url: '/cms/detectC4index/find4cDetailPillarNum',
    method: 'get',
    params: params
  })
}

export function getC4DetailPillarInfo(params) {
  return request({
    url: '/cms/detect4cIndex/getC4DetailPillarInfo',
    method: 'post',
    data: params
  })
}

export function getC4ImageBySiteIdAndPillarId(params) {
  return request({
    url: '/cms/detect4cPicture/getC4ImageBySiteIdAndPillarId',
    method: 'post',
    data: params
  })
}
export function getC4IndexSiteListByDetectJobId(params) {
  return request({
    url: '/cms/detect4cIndex/getC4IndexSiteListByDetectJobId',
    method: 'post',
    data: params
  })
}

export function getC4IndexPillarListByDetectJobIdAndSiteId(params) {
  return request({
    url: '/cms/detect4cIndex/getC4IndexPillarListByDetectJobIdAndSiteId',
    method: 'post',
    data: params
  })
}
/**
 * 5C菜单树
 */
export function find5CMenuTree(params) {
  return request({
    url: '/cms/detectC5/find5CMenuTree',
    method: 'get',
    params: params
  })
}
/**
 * 5C检测图片查询
 */
export function find5CDetectPicture(params) {
  return request({
    url: '/cms/detectC5/find5CDetectPicture',
    method: 'get',
    params: params
  })
}
/**
 * 原始数据统计
 */
export function findOriginalDate(params) {
  return request({
    url: '/cms/originalDate/findOriginalDate',
    method: 'get'
  })
}
/**
 * 原始数据1-6C左侧树结构
 */
export function originalTree(params) {
  return request({
    url: '/cms/originalDate/originalTree',
    method: 'get',
    params: params
  })
}
/**
 * 原始数据1C列表
 */
export function find1OriginalDate(params) {
  return request({
    url: '/cms/originalDate/find1OriginalDate',
    method: 'get',
    params: params
  })
}
/**
 * 原始数据2C列表
 */
export function find2OriginalDate(params) {
  return request({
    url: '/cms/originalDate/find2OriginalDate',
    method: 'get',
    params: params
  })
}
/**
 * 原始数据4C列表
 */
export function find4OriginalDate(params) {
  return request({
    url: '/cms/originalDate/find4OriginalDate',
    method: 'get',
    params: params
  })
}

/**
 * 设备类型查询
 */
export function findDevices() {
  return request({
    url: '/cms/gis/findDevices',
    method: 'get'
  })
}

/**
 * 设备查询（带地理信息）
 * params中可存在cType参数
 */
export function findDevicesGeo(params) {
  return request({
    url: '/cms/gis/findDevicesGeo',
    method: 'get',
    params: params
  })
}

/**
 * 设备查询（带地理信息）
 * params中可存在deviceName参数
 */
export function findDevicesName(params) {
  return request({
    url: '/cms/gis/find5cDeviceData',
    method: 'get',
    params: params
  })
}

/**
 * 设备查询,分页（带地理信息）
 * params中可存在deviceName参数
 */
export function findDevicesNamePage(params) {
  return request({
    url: '/cms/gis/find5cDeviceDataPage',
    method: 'get',
    params: params
  })
}

/**
 * 支柱查询
 * params中可存在cType参数
 */
export function getPillarList(params) {
  return request({
    url: '/basic/pillar/list',
    method: 'get',
    params: params
  })
}

/**
 * 缺陷查询
 *
 */
export function findDefectRepeatedAnalysis(params) {
  return request({
    url: '/cms/jcwDefectInfo/findDefectRepeatedAnalysis',
    method: 'get',
    params: params
  })
}

/**
 * 缺陷查询,按线路分类
 *
 */
export function findDefectsRegionalRelations(params) {
  return request({
    url: '/cms/jcwDefectInfo/findDefectsRegionalRelations',
    method: 'get',
    params: params
  })
}

/**
 * 支柱查询,需传入包络框
 *
 */
export function getPillarListGeo(params) {
  return request({
    url: '/gis/pillar/getPillarList',
    method: 'get',
    params: params
  })
}

/**
 * 缺陷查询,需传入线路id和区站id
 *
 */
export function findPillarDefect(params) {
  return request({
    // url: 'cms/jcwDefectInfo/findPillarDefect',
    url: 'cms/jcwDefectInfo/findPillarOnlyDefect',
    method: 'get',
    params: params
  })
}
